

#!/bin/sh

#
cd XCGraphics

#
buildDay=$(date +%Y%m%d)
buildTime=$(date +%Y%m%d%H%M)

profile="addhocpush"

#
buildConfiguration="Release"
buildPath="../ArchiveProduction/QA/${buildDay}/Auto_QA_${buildTime}.xcarchive"
ipaName="../ipa/QA/${buildDay}/Auto_QA_${buildTime}.ipa"
ipaPath="../ipa/QA/${buildDay}"

mkdir -p ${ipaPath}
#
xctool -scheme XCMultiTarget -configuration ${buildConfiguration} clean
xctool -scheme XCMultiTarget -configuration ${buildConfiguration} archive -archivePath ${buildPath}
xcodebuild -exportArchive -exportFormat IPA -archivePath ${buildPath} -exportPath ${ipaName} -exportProvisioningProfile "$profile"